/********************************************************************************
 *      Copyright:  (C) 2025 TBW
 *                  All rights reserved.
 *
 *       Filename:  sqlite.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(19/05/25)
 *         Author:  huang zixiao <2027838269@qq.com>
 *      ChangeLog:  1, Release initial version on "19/05/25 19:32:08"
 *                 
 ********************************************************************************/

#ifndef					SQLITE_H
#define					SQLITE_H

#include <string.h>
#include <unistd.h>

#include "../sqlite/sqlite3/include/sqlite3.h"


typedef struct callback_arg_s
{
    int      sqlite_have_data;
    char     data_in_db[128];

}callback_arg_t;

typedef struct db_info_s
{
    sqlite3              *db;
    char                 *sqlite_filename;
    char                 *table_name;
    char                 *err_msg;
    
}db_info_t;




int db_init(db_info_t *db_info);

int save_in_db(db_info_t *db_info, void *buf, int size);

int get_data_in_db(db_info_t *db_info, void *buf, int size, int *bytes);

int delete_1st_db(db_info_t *db_info);

int callback(void *arg, int num_columns, char **value, char **name_columus);








#endif
